package org.jeecg.modules.erp.goods.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.erp.goods.entity.ErpGoods;
import org.jeecg.modules.erp.goods.entity.ErpGoodsPackage;
import org.jeecg.modules.erp.goods.vo.ErpGoodsPage;
import org.jeecg.modules.erp.goods.vo.ErpGoodsVo;
import org.jeecg.modules.erp.goods.vo.ErpMateralSupplierVo;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 物料基础信息
 * @Author: jeecg-boot
 * @Date: 2024-05-21
 * @Version: V1.0
 */
public interface IErpGoodsService extends IService<ErpGoods> {

    IPage<ErpGoodsPage> goodsPage(Page<ErpGoods> page , ErpGoods model);


    IPage<ErpGoodsPage> goodsSupplierPage(Page<ErpMateralSupplierVo> page, ErpMateralSupplierVo model);

    List<ErpGoodsPage> goodsSupplierList(ErpMateralSupplierVo model);

    List<ErpGoods> goodsByIds(List<String> ids);

    /**
     * 添加一对多
     *
     * @param erpGoods
     * @param erpGoodsPackageList
     */
    public void saveMain(ErpGoods erpGoods,List<ErpGoodsPackage> erpGoodsPackageList) ;

    /**
     * 修改一对多
     *
     * @param erpGoods
     * @param erpGoodsPackageList
     */
    public void updateMain(ErpGoods erpGoods, List<ErpGoodsPackage> erpGoodsPackageList);

    /**
     * 删除一对多
     *
     * @param id
     */
    public void delMain (String id);

    /**
     * 批量删除一对多
     *
     * @param idList
     */
    public void delBatchMain (Collection<? extends Serializable> idList);

    public List<ErpGoodsVo> queryGoodsAndFormula(List<String> ids);

    public void correlationFormula(ErpGoods erpGoods);

    public List<ErpGoodsVo> queryByReviewId(String id);
}
